﻿using System;
using System.Collections.Generic;
using System.Security.Principal;

namespace CIS.Web.Common
{
	public class UserRoleAction
	{
		public string UserID { get; set; }
		public string UserName { get; set; }
		public string RoleID { get; set; }
		public string RoleName { get; set; }
		public string ActionID { get; set; }
		public string FunctionID { get; set; }
		public int? Browse { get; set; }
		public int? Add { get; set; }
		public int? Modify { get; set; }
		public int? Delete { get; set; }
	}

	public class ConferenceRoleAction
	{
		public string UserID { get; set; }
		public string UserName { get; set; }
		public string ConferenceID { get; set; }
		public string RoleID { get; set; }
		public string RoleName { get; set; }
		public string ActionID { get; set; }
		public string FunctionID { get; set; }
		public int? Browse { get; set; }
		public int? Add { get; set; }
		public int? Modify { get; set; }
		public int? Delete { get; set; }
	}

	public class CISPrincipal : ICISPrincipal
	{
		private IIdentity _identity;

		public string IP { get; set; }

		public string UserID { get; set; }

		public string UserName { get; set; }

		public string Email { get; set; }

		public string ConferenceId { get; set; }

		public string Language { get; set; }

		public bool IsSSA { get; set; }

		public bool IsSA { get; set; }

		public bool IsCA { get; set; }

		public List<string> CSAList { get; private set; }

		public List<UserRoleAction> UserRoleActions { get; private set; }

		public List<ConferenceRoleAction> ConferenceRoleActions { get; private set; }

		public List<string> ConferenceFunctionIdList { get; set; }

		public IIdentity Identity
		{
			get
			{
				return _identity;
			}
		}

		public CISPrincipal(IIdentity identity)
		{
			_identity = identity;
			CSAList = new List<string>();
			UserRoleActions = new List<UserRoleAction>();
			ConferenceRoleActions = new List<ConferenceRoleAction>();
		}

		public bool IsInRole(string role)
		{
			throw new NotImplementedException();
		}
	}
}